package lt.inkredibl.iit;

import java.awt.geom.Line2D.Double;

public abstract class Constraint
{
	private double _c;

	public Constraint(double c)
	{
		_c = c;
	}
	
	public double getC()
	{
		return _c;
	}

	public abstract void crop(Double ln);

	public double diffC(double val)
	{
		return Math.abs(getC() - val);
	}

	public double diff(Double ln)
	{
		return Math.abs(getVal2(ln) - getVal1(ln));
	}

	public abstract boolean outside(double val);

	public abstract boolean inside(double val);
	
	public abstract double getVal1(Double ln);
	
	public abstract double getVal2(Double ln);

	public boolean inside(Double ln)
	{
		return inside(getVal1(ln)) && inside(getVal2(ln));
	}

	public boolean outside(Double ln)
	{
		return outside(getVal1(ln)) && outside(getVal2(ln));
	}
}
